<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta charset="utf-8">
	<title>布置课后作业</title>
	<style type="text/css">
	
		html{
			width:100%;
			height:98%;
		}
		body{
			width:99%;
			height:90%;
			background-image: url("img/qq.jpg");
		}
		#d{
			margin: 0 auto;
			width: 300px;
			margin-top: 50px;
			background:WHITE;
		}
		.in{
			width: 200px;
		}
		.btn{
			width: 147px;
		}
		#t{
			font-size: 36px;
			margin: 0 auto;
			width: 100%;
			margin-top: 30px;
			color: #cc3399;
		}
		#cover{
			position: absolute;
			left: 0px;
			top: 0px;
			width: 100%;
	        height: 100%;
			background-color: #777;
	        z-index: 2;
	        display: none;
	        filter:alpha(Opacity=60);
	        -moz-opacity:0.6;
	        opacity: 0.6; 
	        border-style: solid;
			border-width: 1px;
	}
		#time{
			width:28%;
			height:10%;
			position: absolute;
			z-index: 3;
        	background-color: #00A1FC;
			top: 27%;
			left:36%;
			display:none;
			font-size:16px;
	}
	.ttt{
		margin-top:5%;
		width:10%;
		height:30%;
		border-top:none;
		border-left:none;
		border-right:none;
	}
	#jbar{
			width:24%;
			position: absolute;
			z-index: 3;
        	background-color: #00A1FC;
			top: 25%;
			left:38%;
			display:none;
		}
		#jbar img{
			width:100%;
		}
	</style>
	<script type="text/javascript">
	function stop(){
		return false;
		}
		document.oncontextmenu=stop;
	
		function msg1(){
			alert("考试题目为 txt 文档，每道题必须以 ‘#*#’ 开头");
		}
		function msg2(){
			alert("此文件必须是 .sql的批处理文档");
		}
		function jump(){
			window.location.href = "backStage.jsp";
		}
		function createJ(){
			document.getElementById("cover").style.display = "block";
			document.getElementById("jbar").style.display = "block";
		}
		function stopJ(){
			document.getElementById("cover").style.display = "none";
			document.getElementById("jbar").style.display = "none";
		}
		function fail(str){
			alert(str);
		}
		function success(){
			alert("发题成功！");
			window.location.href = "backStage.jsp";
		}
		function getTime(){
			var year = document.getElementById("year").value;
			var month = document.getElementById("month").value;
			var date = document.getElementById("date").value;
			var hour = document.getElementById("hour").value;
			var min = document.getElementById("min").value;
			if(year.length!=4)return;
			if(hour.length==1) hour="0"+hour;
			if(min.length==1) min="0"+min;
			return year+"-"+month+"-"+date+" "+hour+":"+min+":"+"00";
		}
		function setTime(){
			document.getElementById("time").style.display = "none";
			document.getElementById("xxx2").value = getTime();
		}
		function show(){
			document.getElementById("time").style.display = "block";
		}
	</script>
</head>
<body>

<div id="cover"></div>
	<div id="jbar"> 
		<img src="img/sub.gif">
	</div>
	
	<div id="time">
		<input type="text" class="ttt" id="year">年
		<input type="text" class="ttt" id="month">月
		<input type="text" class="ttt" id="date">日
		<input type="text" class="ttt" id="hour">时
		<input type="text" class="ttt" id="min">分
		<input type="button" onclick="setTime()"  id="sure" value="确定">
	</div>
	
	<div id="t"> <center><label>布置课后作业</label></center> </div>
	<div id="d">
		<form method="post" enctype="multipart/form-data" action="makePractise.view">
			<table id="tab" border="1">
				<tr>
					<td>名称</td>
					<td><center>值</center></td>
				</tr>
				<tr>
					<td>作业名称</td>
					<td>  <input class="in" type="text" name="partName" style="border-style:none"> </td>
				</tr>
				<tr>
					<td>结束时间</td>
					<td> <input id="xxx2" onfocus="show()" class="in" type="text" name="endTime" style="border-style:none"> </td>
				</tr>
				<tr>
					<td>添加作业题</td>
					<td> <input class="in" type="file" name="subjectFile" onclick="msg1()"> </td>
				</tr>
				<tr>
					<td>添加数据环境</td>
					<td> <input class="in" type="file" name="sqlFile" onclick="msg2()"> </td>
				</tr>
			</table>
			<input type="hidden" name="callback" value="callback">
			<input class="btn" type="button" name="cannel" value="放弃" onclick="jump()">
			<input class="btn" onclick="createJ()" type="submit" name="cannel" value="确认">
		</form>
	</div>
	<script> <%=request.getAttribute("callback")  %> </script>
</body>
</html>
